package com.un.ebs.sys.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.un.ebs.core.enums.DbTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


/**
 * @Author aikun
 * @ClassName DataSource
 * @Description DataSource
 * @Date 2020/1/8
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_data_source")
public class DataSource extends Model<DataSource> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.UUID)
    private String id;

    @NotBlank(message = "数据源名称不能为空")
    private String name;

    @NotBlank(message = "库名称不能为空")
    private String libraryName;

    @NotBlank(message = "驱动名称不能为空")
    private String driveName;

    @NotNull(message = "数据源类型不能为空")
    private DbTypeEnum dbType;

    @NotBlank(message = "用户名不能为空")
    private String userName;

    @NotBlank(message = "密码不能为空")
    private String password;

    @NotBlank(message = "连接URL不能为空")
    private String ipAddr;

    private String remark;
}
